# Copyright (c) 2018 Presto Labs Pte. Ltd.
# Author: jhkim

from coin.strategy.mm.base.feed_arb_base import (FeedArbSubscriberHandler, FeedArbSubsystem)
from coin.strategy.mm.subscription import SubscriptionRequest

from coin.exchange.huobi.ws.subscriber import HuobiSubscriber
from coin.strategy.mm.feed_arb import (HuobiFeedArbFlowBookBuilder)


class HuobiFeedArbSubscriberHandler(FeedArbSubscriberHandler):
  SubscriberType = HuobiSubscriber


class HuobiFeedArbSubsystem(FeedArbSubsystem):
  FlowBookBuilder = HuobiFeedArbFlowBookBuilder
  FeedSubscriber = HuobiFeedArbSubscriberHandler
  FeedSubReq = SubscriptionRequest('Spot', 'Huobi', None)

  def set_price_limit_error_callback(self, callback):
    self._price_limit_error_callback = callback
